<?php

class Subscription extends DataMapper {
	
	var $table_name	= 'subscriptions';
    
    var $has_one = array(
			'user' => array(			
	            'class' => 'user',
	            'other_field' => 'subscription',
	            'join_self_as' => 'subscription',
	            'join_other_as' => 'user',
	            'join_table' => 'r_subscriptions_users'),
    );
    
//     var $validation = array(
//     	'reftype_rating' => array(
//             'label' => 'Type rating',
//             'rules' => array('required', 'trim', 'integer'),
// 		),
// 		'rated_item_id' => array(
//             'label' => 'Rated Item ID',
//             'rules' => array('required', 'trim', 'integer'),
// 		),
// 		'rating' => array(
//             'label' => 'Rating value',
//             'rules' => array('required', 'trim', 'valid_match' => array('1', '2', '3', '4', '5')),
// 		)
//     );
    
//     function _integer($field)
//     {
//     	return ( ! preg_match('/^([0-9])+$/i', $field)) ? FALSE : TRUE;
//     }
}

/* End of file rating.php */
/* Location: ./application/models/rating.php */